package com.wen.task.baseTasks;

import com.wen.entry.Result;
import com.wen.moudle.Account;
import com.wen.moudle.Managers.FightManager;
import com.wen.task.AbstractTask;
import lombok.extern.slf4j.Slf4j;

// 自动打关卡
@Slf4j
public class BossTask extends AbstractTask {

    private FightManager fightManager;

    public BossTask(Account account) {
        super(account);
        fightManager = getFightManager();
    }

    @Override
    public String getTitle() {
        return "一键打关卡";
    }

    @Override
    public void run() {
            log.info("开始挑战关卡,请等待");
            for (int i = 1; i <= 6; i++) {
                Result<String> result = fightManager.fightBoss(i);
                log.info("{}",result.isSuccess() ?  "挑战成功": result.getErrorMessage());
            }
    }
}
